package com.tj.template.config.vo;

import com.tj.bo.user.client.vo.bean.UserBaseVo;

import java.io.Serializable;

/**
 * @program: binary-option
 * @description 用户登录信息
 * @author: binary
 * @create: 2020-06-08 18:13
 **/
public class UserAccessInfo implements Serializable {

    /**
     * 0-游客(IMEI)登录 1-email/openid登录
     */
    private Integer loginMode = 0;

    /**
     *客户码
     */
    private String userCode;

    private UserBaseVo userBaseReal;

    private UserBaseVo userBaseDemo;

    public UserAccessInfo() {
    }

    public UserAccessInfo(Integer loginMode, String userCode, UserBaseVo userBaseReal, UserBaseVo userBaseDemo) {
        this.loginMode = loginMode;
        this.userCode = userCode;
        this.userBaseReal = userBaseReal;
        this.userBaseDemo = userBaseDemo;
    }

    public Integer getLoginMode() {
        return loginMode;
    }

    public UserAccessInfo setLoginMode(Integer loginMode) {
        this.loginMode = loginMode;
        return this;
    }

    public String getUserCode() {
        return userCode;
    }

    public UserAccessInfo setUserCode(String userCode) {
        this.userCode = userCode;
        return this;
    }

    public UserBaseVo getUserBaseReal() {
        return userBaseReal;
    }

    public UserAccessInfo setUserBaseReal(UserBaseVo userBaseReal) {
        this.userBaseReal = userBaseReal;
        return this;
    }

    public UserBaseVo getUserBaseDemo() {
        return userBaseDemo;
    }

    public UserAccessInfo setUserBaseDemo(UserBaseVo userBaseDemo) {
        this.userBaseDemo = userBaseDemo;
        return this;
    }

    /**
     * 判断是否游客
     *
     * @return
     */
    public boolean isVisitors() {
        return loginMode == 0;
    }
}
